package com.kis.model

import org.springframework.util.StringUtils

/**
 * Created by wongloong on 16-12-6.
 */
class ResponseData {
    var statusCode: Int = 300
    var success: Boolean = false
    var closeCurrent = true
    var obj: Any? = null
    var message: Any = "操作失败!"

    constructor()
    constructor(isSuccess: Boolean, data: Any? = null) {
        if (isSuccess) {
            this.success = true
            this.statusCode = 200
            if (StringUtils.isEmpty(data).not()) {
                this.obj = data
            }
            this.message = "操作成功!"
        } else {
            closeCurrent=false
            if (StringUtils.isEmpty(data).not()) {
                this.message = data.toString()
            }
        }
    }
}